<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>驻店信息</title>
<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="${contextPath}/scripts/linkage.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	//pc_init();
	//setProvCity("${province}","${city}");
});
</script>
</head>
<body>
<div class="navigation">
	    <span>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>系统管理&gt;&gt;驻店管理
    </div>
<div class="xt_main_right_center">
<form name="searchForm"  method="post" id="searchForm" action="index.do">
<input type="hidden" name="redirectUrl" value='<s:property value='redirectUrl'/>'/>
  <table  width="100%" border="0" cellpadding="0" cellspacing="0"    style="border-color:#CCCCCC;"  >
    <tr>
      <td class="left-td-width-bg" >店号：</td>
      <td  class="right-td-width-bg-left" > <input class="input" type="text" name="shop.shopMark" value="${shop.shopMark}" id="shop.shopMark"></td>
      <td class="left-td-width-bg" >店名：</td>
      <td  class="right-td-width-bg-left" ><input class="input" type="text" name="shop.shopName" value="${shop.shopName}"  id="shop.shopName"></td>
      <td class="left-td-width-bg" >省：</td>
      <td  class="right-td-width-bg-left" rowspan="2">
       <!-- <select name="province">
       		 
       </select> -->
       <s:if test="provinces!=null">
	      <s:doubleselect list="provinces" listKey="id" listValue="name" name="province" 
	      value="province" doubleName="city" 
	      doubleList="top.childs" doubleListKey="id" doubleListValue="name" 
	       formName="searchForm" headerKey="" headerValue="请选择省份" 
	       doubleHeaderKey="" doubleHeaderValue="请选择市"
	       doubleValue="city"
	      theme="simple">
	      </s:doubleselect>
      </s:if>

      
      </td>
      <td class="left-td-width-bg" align="left">区域：
      </td>
      <td class="right-td-width-bg-left">
       <select name="shop.area.name" id="select2">
	      <option value="">****请选择****</option>
		<s:iterator value="domainshopList" status="i" id="b">
			<option <s:if test='shop.area.name==#b.name'>selected="selected"</s:if>  value="${b.name }">${b.name }</option>
		</s:iterator>
              </select>
    </tr>
    <tr>
      <td class="left-td-width-bg" align="left">渠道：       </td>
         <td  class="right-td-width-bg-left">
         <select name="brand.name" id="select2">
	             <option value="">****请选择****</option>
			         <s:iterator value="listBrand" status="i" id="b">
			          <option <s:if test='brand.name==#b.name'>selected="selected"</s:if>  value="${b.name }">${b.name }</option>
			          </s:iterator>
              </select>
          </td>
    
      <td  class="left-td-width-bg" align="left">销售公司：</td>
        <td class="right-td-width-bg-left">  <input  class="input"   type="text" name="shop.company" value="${shop.company }"  id="shop.company">
     </td>
      <td  class="left-td-width-bg" align="left">市：</td>
        <!--   <td class="right-td-width-bg-left">
          <select name="city"></select> 
      </td> -->
      <td  class="left-td-width-bg" align="left">状态：</td>
          <td class="right-td-width-bg-left">
          <select name="shop.toDelete" id="select2">
	             <option selected="selected" value="1">启用</option>
	             <option <s:if test='shop.toDelete==0'>selected="selected"</s:if> value="0">禁用</option>
              </select>
      </td>
    </tr>
    <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
      <td height="28" colspan="8" align="right" style="border-bottom:none;">
     	<input type="submit" name="button" id="button" class="btn_query" value="">
        <input type="reset" name="button2" onClick="clearForm(this.form);return false;"  class="btn_clear_form"  id="button2" value="">  </td>      
    </tr>
  </table>
  </form>
</div>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="50%" align="right">&nbsp;</td>
      <td width="50%" colspan="8" align="right">&nbsp;</td>
    </tr>
    <tr>
      <td align="left"><font color="#0066CC"><strong>查询结果：</strong></font></td>
      <td colspan="8" align="right">
       <jysz:permission code="SYS_SHOP_IMPORT">
      <a href="javascript:ImportD()"><img src="${contextPath}/images/import.png" alt="导入驻店信息" /></a>&nbsp;&nbsp;&nbsp;&nbsp;
      </jysz:permission>
       <jysz:permission code="SYS_SHOP_ADD">
      <a href="javascript:add()"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a>
      </jysz:permission></td>
      
    </tr>
  </table>
  <table  width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
    <tr>
      <td class="top-td-width-bg">序号</td>
      <td class="top-td-width-bg">店号</td>
      <td class="top-td-width-bg">店名</td>
      <td class="top-td-width-bg">省</td>
      <td class="top-td-width-bg">市</td>
      <td class="top-td-width-bg">区域</td>
      <td class="top-td-width-bg">渠道</td>
      <td class="top-td-width-bg">销售公司</td>
      <td class="top-td-width-bg">邮编</td>
      <td class="top-td-width-bg">地址</td>
      <td class="top-td-width-bg">操作</td>
    </tr>
    <s:iterator value="page.result" status="i" id="u">
    <tr>
      <td class="down-center-td-width-bg">${i.count}</td>
      <td class="down-center-td-width-bg">${u.shopMark }</td>
      <td class="down-center-td-width-bg">${u.shopName }</td>
      <td class="down-center-td-width-bg">${u.province }</td>
      <td class="down-center-td-width-bg">${u.city }</td>
      <td class="down-center-td-width-bg">${u.area.name }</td>
      <td class="down-center-td-width-bg"> 
      	<s:iterator value="#u.brands" status="q" id="a">
      		${a.name },
      	</s:iterator>
      </td>
      <td class="down-left-td-width-bg">${u.company }</td>
      <td class="down-center-td-width-bg">${u.postcode }</td>
      <td class="down-left-td-width-bg">${u.address }</td>
     
      <td class="down-center-td-width-bg">
       <jysz:permission code="SYS_SHOP_EDIT">
      <a href="javascript:sumitB(${u.id })" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /> </a></jysz:permission>
      &nbsp;&nbsp;<a href="javascript:details(${u.id })" title="详细"><img src="${contextPath}/images/chakan.gif" alt="详细" width="16" height="13" border="0" /></a>
      <jysz:permission code="SYS_SHOP_DEL">
      &nbsp;&nbsp;<a href="javascript:deleteD(${u.id })" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a></jysz:permission></td>
    </tr>
    </s:iterator>
   
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0"  >
    <tr>
      <td height="36" colspan="8" class="down-center-td-width-bg" align="right"><%@ include file="/WEB-INF/view/common/pagination.jsp"%></td>
    </tr>
  </table>
  <br/><br/><br/><br/><br/>
		<div><jsp:include page="/include/footer.inc"></jsp:include></div>
  <p>&nbsp;</p>

<script type="text/javascript">
function sumitB(id){
	var searchForm = document.searchForm;
	searchForm.action = "minute.do?currentPage=${currentPage}&search.id=" + id;
	searchForm.submit();
}
function deleteD(id){
	if(confirm("确认要禁用吗?")) {
	var searchForm = document.searchForm;
	searchForm.action = "DeleteShopAction.do?currentPage=${currentPage}&search.id="+id;
	searchForm.submit();
	}
}
function details(id){
	var searchForm = document.searchForm;
	searchForm.action ="details.do?currentPage=${currentPage}&search.id="+id;
	searchForm.submit();
}
function add(){
	var searchForm = document.searchForm;
	searchForm.action ="add.do?currentPage=${currentPage}";
		searchForm.submit();
}
function ImportD(){
	var searchForm = document.searchForm;
	searchForm.action ="tolead.do?currentPage=${currentPage}";
		searchForm.submit();
	
}
 
function next(i){
		var pageNo = parseInt(document.getElementById("pageNo").value)+i;
		document.getElementById("pageNo").value = pageNo;
		document.getElementById("form").submit();
	} 
function jumpPage(page) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/system/shop/index.do?currentPage=" + page;
		searchForm.submit();
	}
 
</script>
</body>
</html>